<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">

<h:head>
	<title>Selezione Hotel</title>
	<link rel="stylesheet" type="text/css" href="../styles/style.css" />
</h:head>

<h:body>
<div id="container">
<div id="box">

<header class="banner">
<span id="titoloPagina"> Scegli l'hotel </span>
</header>

<div id="externalborder1">
<p:spacer height="40px" />

 <h:form id="form"> 
      
      <p:growl id="growl" showDetail="true" sticky="true" />
     
	<h:panelGroup  rendered="#{param.noIst}">
			<div id="infoAgg" style="text-align: center;"><h:outputText value="Non hai selezionato nessun hotel"/><br/>
			</div>
			</h:panelGroup>
			<p:spacer height="40px" />
	<div id="externalborderTab"> 
	
	
		<p:dataTable id="hotelSelection" var="istanzaDTO" rowKey="#{istanzaDTO.idIstanza}" value="#{creaViaggio.hotelDB}" paginator="true" rows="7"
                 selection="#{creaViaggio.istanzaTmp}" selectionMode="single" sortMode="multiple" style="text-align:center;">  
       
  		 	<p:ajax event="rowSelect" update=":form:growl" listener="#{creaViaggio.onRowSelectHotel}"/>
		 
  			<p:column id="nome" sortBy="elemento.nome" headerText="Nome">  
	            <h:outputText value="#{istanzaDTO.elemento.nome}" />  
	        </p:column>
  
			<p:column id="tipoStanza" sortBy="elemento.multy" headerText="Tipo Stanza">  
	            <h:outputText value="#{istanzaDTO.elemento.multy}" />  
	        </p:column>  		
  
 	        <p:column id="dataInizio" sortBy="dataInizio" headerText="Data Arrivo" >  
	            <h:outputText value="#{istanzaDTO.dataInizio}" >  
                <f:convertDateTime pattern="dd/MM/yyyy HH:mm" />    
            </h:outputText>    
	        </p:column>  
	  
	  		<p:column id="dataFine" sortBy="dataFine" headerText="Data Partenza">  
	            <h:outputText value="#{istanzaDTO.dataFine}">  
                <f:convertDateTime pattern="dd/MM/yyyy HH:mm" />    
            </h:outputText>    
	        </p:column>
	  
	  		<p:column id="descrizione" sortBy="elemento.descrizione" headerText="Numero Stelle">  
	            <h:outputText value="#{istanzaDTO.elemento.descrizione}" />  
	       </p:column>  
	  
	        <p:column id="disponibilita" sortBy="disponibilita" headerText="Camere Disponibili">  
	            <h:outputText value="#{istanzaDTO.disponibilita}" />  
	        </p:column>  
	           
	        <p:column id="prezzo" sortBy="prezzo" headerText="Prezzo (a camera)">  
	            <h:outputText value="#{istanzaDTO.prezzo}" />  
	        </p:column>
	           	       
	   	</p:dataTable>
    </div>
    
 </h:form>
 <p:spacer height="40px" />
 <h:form> 
 	<div id="columnBox" style="margin:0px auto; width:70%">
	
	<div id="column1" style="float:left; margin:0; margin-left:7%; width:33%;">
<a id="loginlink" href="selezionePacchetto.xhtml">
					<div class = "button" id = "indietro">
						Indietro
					</div>
				</a>
</div>

<div id="column2" style="float:left; margin:0;width:25%;">
<div class="padder" id="padder">
</div>
</div>

<div id="column3" style="float:left; margin:0;width:25%;">
	<div id="registerButton">
<h:commandLink id="registerlink" action="#{creaViaggio.addIstanzaTmp1()}">
<div class="button" id="register">
Procedi
</div>
</h:commandLink>
</div>

				</div>
				</div>

   </h:form> 
 </div>
</div>
<div id="push">
</div>
</div>

<div id="footer">
<h:button id="homepage" value="Homepage" outcome="index.xhtml"></h:button>	
</div>

</h:body>  
</html>